﻿using System;
using System.Linq;

namespace Listing1_25
{
    public static class Program
    {
        public static void Main()
        {
            var numbers = Enumerable.Range(0, 20);
            var parallelResult = numbers.AsParallel().AsOrdered()
            .Where(i => i % 2 == 0).AsSequential();
            foreach (int i in parallelResult.Take(7))
                Console.WriteLine(i);
            Console.ReadKey();
        }
    }
}